
/**
 * url转对象
 * @param url url
 * @returns 
 */
export const urlObj = (url: string): Object => {
  let theRequest = new Object();
  if (url.indexOf("?") != -1) {
    let urlString: string[] = url.split("?");
    if (urlString.length > 1) {
      urlString = urlString[1].split("&");
      for (let i = 0; i < urlString.length; i++) {
        theRequest[urlString[i].split("=")[0]] = urlString[i].split("=")[1];
      }
    }
  }
  return theRequest;
}
